<html>
<head>
<meta charset="utf-8">
<title>cupblog | 自己的博客</title>
<link rel="stylesheet" href="/admin/style/dd.css">
<link rel="stylesheet" href="/admin/style/login.css">
<link rel="stylesheet" href="/admin/style/login-style.css">
<script type="text/javascript" src="/admin/script/crypto-min.js"></script>
<script type="text/javascript" src="/admin/script/crypto-sha1.js"></script>
<script type="text/javascript" src="/admin/script/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
function login()
{
    // 取用户名和密码，一次哈希
    var source = $('#username').val() + $('#password').val();
    var bytes = Crypto.SHA1(source, { asBytes: true });
    var hash = Crypto.util.bytesToHex(bytes);

    // 取时间，二次哈希
    var now = new Date();
    var dateStr = now.getYear() + '/' + now.getMonth() + '/' + now.getDay();

    source = hash + dateStr;
    bytes = Crypto.SHA1(source, { asBytes: true });
    hash = Crypto.util.bytesToHex(bytes);

    $('#date').val(dateStr);
    $('#passwordHash').val(hash);

    document.forms[0].submit();
}
</script>
</head>

<body>
<div id="startpage" class="clearfix">
<div id="startpage-wrap">
<h1 id="logo-startpage">PenBlog</h1>
<div id="login-wrap">
<form class="clearfix" method="post">
<ul class="list clearfix">
<li class="li clearfix">
    <div class="item-title">用户名</div>
    <div class="item">
        <input type="text" name="username" class="ui-text" value="{{ admin }}" {{ is_to_install|yesno:"readonly=&quot;readonly&quot;," }}>
    </div>
    <div class="item-des">{{ is_to_install|yesno:"创建指定管理员账户，为安装做准备,仅限字母、数字和下划线" }}</div>
    <input type="hidden" name="is-to-install" value="{{ is_to_install }}">
</li>
<li class="li clearfix">
    <div class="item-title">密码</div>
    <div class="item">
        <input type="password" name="password" class="ui-text">
    </div>
    <div class="item-des">密码不能少于6位</div>
</li>
<li class="li clearfix">
    <div class="item-title">重复密码</div>
    <div class="item">
        <input type="password" name="password-repeat" class="ui-text">
    </div>
    <div class="item-des"></div>
</li>
<li class="li clearfix">
    <div class="item-title">昵称</div>
    <div class="item">
        <input type="text" name="nickname" class="ui-text ">
    </div>
    <div class="item-des">昵称作为文章的作者显示</div>
</li>
<li class="li clearfix normal">
    <div class="item-title">电子邮箱</div>
    <div class="item">
        <input type="text" name="email" class="ui-text">
    </div>
    <div class="item-des"></div>
</li>
<li class="li clearfix normal">
    <input type="submit" class="input-button" style="float: right;margin-right: 200px;" value="创建账户" />
</li>
</ul>

</form>
</div>
<div id="footer">

</div>
</div>
</div>
</body>
</html>